local Lua__nhya = fk.CreateSkill {

  name = "Lua__nhya",

  tags = { Skill.Compulsory, },

}

Fk:loadTranslationTable{
    
    ["Lua__nhya"] = "你很勇啊",
    ["$Lua__nhya1"] = "听不清（全损音质）",
    [":Lua__nhya"] = "锁定技，当一名其他角色技能或手牌为全场最多时，你对其造成1点伤害。",
    
}

Lua__nhya:addEffect(fk.AfterCardsMove, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        if not player:hasSkill(Lua__nhya.name) then return false end
        local room = player.room
        for _, move in ipairs(data) do
            if move.to and move.to ~= player and move.toArea == Card.PlayerHand then
                if table.every(room:getOtherPlayers(move.to), function(p) return move.to:getHandcardNum() > p:getHandcardNum() end) then
                    return true
                end
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        for _, move in ipairs(data) do
            if move.to and move.to ~= player and move.toArea == Card.PlayerHand then
                if table.every(room:getOtherPlayers(move.to), function(p) return move.to:getHandcardNum() > p:getHandcardNum() end) then
                    room:damage({
                        from = player,
                        to = move.to,
                        damage = 1,
                        skillName = Lua__nhya.name
                    })
                    if player:usedSkillTimes(Lua__nhya.name, Player.HistoryTurn) >= 10 then
                        player:chat("阿杰哥哥要生气了哦😡")
                            room:damage({
                            from = player,
                            to = move.to,
                            damage = 100,
                            skillName = Lua__nhya.name
                        })
                    end
                end
            end
        end
    end,
})
Lua__nhya:addEffect(fk.EventAcquireSkill, {
    anim_type = "offensive",
    can_trigger = function(self, event, target, player, data)
        if not player:hasSkill(Lua__nhya.name) then return false end
        local room = player.room
        if target ~= player then
            if table.every(room:getOtherPlayers(target), function(p) return #target.player_skills > #p.player_skills end) then
                return true
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        if target ~= player then
            if table.every(room:getOtherPlayers(target), function(p) return #target.player_skills > #p.player_skills end) then
                room:damage({
                    from = player,
                    to = target,
                    damage = 1,
                    skillName = Lua__nhya.name
                })
                if player:usedSkillTimes(Lua__nhya.name, Player.HistoryTurn) >= 10 then
                    player:chat("阿杰哥哥要生气了哦😡")
                        room:damage({
                        from = player,
                        to = target,
                        damage = 100,
                        skillName = Lua__nhya.name
                    })
                end
            end
        end
    end,
})

return Lua__nhya